#include <algorithm>
#include <vector>
#include <string>
#include <iostream>

using namespace std;

void biggies(vector<string> &, vector<string>::size_type, ostream &, char);

int main()
{
    vector<string> words{"jumps", "quick", "turtle"};
    biggies(words, words.size(), cout, '!');
}

void biggies(vector<string> &words,
                vector<string>::size_type sz,
                ostream &os = cout, char c = ' ')
{
    // sz 为隐式捕获，值捕获方式
    auto wc = find_if(words.begin(), words.end(),
                        [=](const string &s)
                            { return s.size() >= sz; });
    // 其他处理与之前例子一样
    // os 隐式捕获，引用捕获方式；c 显式捕获，值捕获方式
    for_each(words.begin(), words.end(),
                [&, c](const string &s) { os << s << c; });
    cout << endl;
    // os 显式捕获，引用捕获方式；c 隐式捕获，值捕获方式
    for_each(words.begin(), words.end(),
                [=, &os](const string &s) { os << s << c; });
}